package com.spark.lola.entity.statistics;

import java.math.BigDecimal;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.lola.entity.warehouse.OrderInfo;
import com.spark.lola.support.common.util.TimeUtil;
import com.spark.lola.support.mybatis.entity.BaseModel;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 供应商日报
 * </p>
 *
 * @author dengyejun
 * @since 2020-06-16
 */
@TableName("statistics_supplier")
@ApiModel(value="Supplier对象", description="")
public class StatisticsSupplier extends BaseModel implements Serializable {
    private static final long serialVersionUID=1L;
    public StatisticsSupplier(){}
    public StatisticsSupplier(Long parentId, OrderInfo orderInfo){
        Integer month = TimeUtil.getMonth(orderInfo.getTradeDay());
        Integer year = TimeUtil.getYear(orderInfo.getTradeDay());
        this.parentId = parentId;
        this.createDate = orderInfo.getTradeDay();
        this.createMonth = month;
        this.createYear = year;
    }
    private Long parentId;

    @ExcelProperty("供应商")
    @TableField(exist = false)
    private String parentName;

    @ApiModelProperty(value = "创建日期 yyyy-MM-dd")
    @ExcelProperty("创建日期")
    private Date createDate;

    @ApiModelProperty(value = "创建月份 yyyyMM")
    @ExcelProperty("创建月份")
    private Integer createMonth;

    @ApiModelProperty(value = "创建年份yyyy")
    @ExcelProperty("创建年份")
    private Integer createYear;

    @ApiModelProperty(value = "采购单数量")
    @ExcelProperty("采购单数量")
    private Integer orderCount=0;

    @ApiModelProperty(value = "采购金额")
    @ExcelProperty("采购金额")
    private BigDecimal orderSales= BigDecimal.ZERO;

    @ApiModelProperty(value = "采购重量")
    @ExcelProperty("采购重量")
    private BigDecimal orderWeight= BigDecimal.ZERO;

    @ApiModelProperty(value = "已结算金额")
    @ExcelProperty("已结算金额")
    private BigDecimal orderPayment = BigDecimal.ZERO;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Integer getCreateMonth() {
        return createMonth;
    }

    public void setCreateMonth(Integer createMonth) {
        this.createMonth = createMonth;
    }

    public Integer getCreateYear() {
        return createYear;
    }

    public void setCreateYear(Integer createYear) {
        this.createYear = createYear;
    }

    public Integer getOrderCount() {
        return orderCount;
    }

    public void setOrderCount(Integer orderCount) {
        this.orderCount = orderCount;
    }

    public BigDecimal getOrderSales() {
        return orderSales;
    }

    public void setOrderSales(BigDecimal orderSales) {
        this.orderSales = orderSales;
    }

    public BigDecimal getOrderWeight() {
        return orderWeight;
    }

    public void setOrderWeight(BigDecimal orderWeight) {
        this.orderWeight = orderWeight;
    }

    public BigDecimal getOrderPayment() {
        return orderPayment;
    }

    public void setOrderPayment(BigDecimal orderPayment) {
        this.orderPayment = orderPayment;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "StatisticsSupplier{" +
                "parentId=" + parentId +
                ", parentName='" + parentName + '\'' +
                ", createDate=" + createDate +
                ", createMonth=" + createMonth +
                ", createYear=" + createYear +
                ", orderCount=" + orderCount +
                ", orderSales=" + orderSales +
                ", orderWeight=" + orderWeight +
                ", orderPayment=" + orderPayment +
                ", updateTime=" + updateTime +
                ", id=" + id +
                '}';
    }
}
